<!DOCTYPE html>
<html lang="en">
<head>
    <title>Openfire: Translator Guide</title>
    <link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>

<article>

    <header>
        <img src="images/header_logo.gif" alt="Openfire Logo" />
        <h1>Translator Guide</h1>
    </header>

    <nav>
        <a href="index.html">&laquo; Back to documentation index</a>
    </nav>

    <section id="intro">

        <h2>Introduction</h2>

        <p>
            The Openfire admin console can be easily translated into other languages. This document
            provides instructions for those that wish to make translations.
        </p>
        <p>
            All text in the Openfire admin console is stored in a resource
            bundle. A resource bundle is a file containing key/value pairs.  Words and phrases are
            represented using keys. The correct values are retrieved based on locale settings
            (English values are used for English locales, French values for French locales, etc.).
            Key/value pairs in the English resource bundle might look like the following:
        </p>
        <fieldset>
            <legend>Example key/value pairs in an English i18n bundle</legend>
            <pre>skin.yes=Yes
skin.no=No
skin.topic=Topic
skin.message=Message</pre>
        </fieldset>

        <p>
            The German resource bundle would contain the same keys, but different values:
        </p>
        <fieldset>
            <legend>Example key/value pairs in an English i18n bundle</legend>
            <pre>skin.yes=<i>Ja</i>
skin.no=<i>Nein</i>
skin.topic=<i>Thema</i>
skin.message=<i>Beitrag</i></pre>
        </fieldset>

        <p>
            Making your own translation involves copying the English resource bundle,
            renaming the file, then translating its contents.
        </p>

    </section>

    <section>

        <h2>Construct a Resource Bundle</h2>

        <p>
            To start, make a copy of the default (English) locale file "openfire_i18n.properties".
            It can be found in the <code>resources\i18n</code> directory of your Openfire
            installation. Note: the files found in <code>resources\i18n</code> are copies of the
            real resource bundles used by the application (the real resource bundles are contained
            in the openfire.jar file). Editing the resource files in the <code>resources\i18n</code>
            directory will not affect your running copy of Openfire.
        </p>
        <p>
            Next, you'll need to rename the file to match the locale that you're making a
            translation for. The syntax of the name is "openfire_i18n_[lang]_[country].properties".
            However, the country code should be used in most cases. For example, the German resource
            bundle should be named "openfire_i18n_de.properties" because
            "de" is the language code for German. For French, the file would be called
            "openfire_i18n_fr.properties". A list of language codes can
            be found at: <a href="https://www.ics.uci.edu/pub/ietf/http/related/iso639.txt"
            target="_new">http://www.ics.uci.edu/pub/ietf/http/related/iso639.txt</a>.
            Some locales require a combination of language and country code. For example
            simplified Chinese would have the name "openfire_i18n_zh_CN.properties"
            while traditional Chinese would have the name "openfire_i18n_zh_TW.properties".
        </p>

    </section>

    <section>

        <h2>Translate the Resource Bundle</h2>

        <p>
            Next, use your favorite text editor to translate the English values into
            your language. The key names must not be changed.
        </p>

    </section>

    <section>

        <h2>Testing Your Translation</h2>

        <p>
            To test your translation, copy the translated resource bundle file (example,
            openfire_i18n_de.properties) to the <code>lib/</code> directory of your Openfire
            installation. Make sure Openfire is stopped and then edit the <code>conf/openfire.xml</code>
            file. Set the <code>locale</code> property to match your new resource
            bundle such as "de" or "zh_CN". Start Openfire and the admin console
            should now be using your translation. If you still see English text you may have
            named your bundle incorrectly or used the wrong value for the <code>locale</code>
            property.
        </p>
        <p>
            Once your translation is complete and tested, please submit it to the Openfire
            developers so that others can enjoy it in the next release!
        </p>

    </section>

    <footer>
        <p>
            An active support community for Openfire is available at
            <a href="https://discourse.igniterealtime.org">https://discourse.igniterealtime.org</a>.
        </p>
    </footer>

</article>

</body>
</html>
